home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tclX-6.4 / help / control / foreach < prev    next >
Encoding:
Text File  |  1992-12-17  |  704 b   |  12 lines

  1.           foreach varname list body
  2.                In this command, varname is the  name  of  a  variable,
  3.                list is a list of values to assign to varname, and body
  4.                is a collection of Tcl commands.   For  each  field  in
  5.                list (in order from left to right), foreach assigns the
  6.                contents of the field to  varname  (as  if  the  lindex
  7.                command had been used to extract the field), then calls
  8.                the Tcl interpreter to execute  body.   The  break  and
  9.                continue  statements  may  be invoked inside body, with
  10.                the same effect as in  the  for  command.   Foreach  an
  11.                empty string.
  12.